<?php 
if(!empty($_POST)){
   $chinese=$_POST['chinese'];
   $math=$_POST['math'];
if($chinese=="" || !($chinese>=0 && $chinese<=100) || !is_numeric($chinese)){
  echo "语文成绩必须在0-100之间";
}
elseif($math=="" || !($math>=0 && $math<=100) || !is_numeric($math)){
    echo "数学成绩必须在0-100之间";
}
else{
    $chinese+=0;
    $math+=0;
$average=($chinese+$math)/2;
echo "您的平均分是：".$average.'</br>';
if($average<=60){
    echo 'E';
}
elseif($average>60 && $average<=70){
    echo 'D';
}
elseif($average>70 && $average<=80){
    echo 'C';
}elseif($average>80 && $average<=90){
    echo 'B';
}
else{
    echo 'A';
}
}
}

?>
<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
<form action="" method="post">
    语文:<input type="text" name="chinese"><br>
   数学:<input type="text" name="math"><br>
    <input type="submit" value="判断成绩">
</form>
</body>

</html>